package net.yvesd.cellhunter.model;

public class Cell {

	private int cid;
	private int lac;
	private String name;

	public Cell(int lac, int cid) {
		this.lac = lac;
		this.cid = cid;
		this.name = lac + "-" + cid;
	}

	public Cell(int lac, int cid, String name) {
		this.lac = lac;
		this.cid = cid;
		this.name = name;
	}

	public int getLac() {
		return lac;
	}

	public void setLac(int lac) {
		this.lac = lac;
	}

	public int getCid() {
		return cid;
	}

	public void setCid(int cid) {
		this.cid = cid;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	@Override
	public boolean equals(Object other) {
		// Not strictly necessary, but often a good optimization
		if (this == other)
			return true;

		if (!(other instanceof Cell))
			return false;

		Cell otherCell = (Cell) other;

		return getLac() == otherCell.getLac() && getCid() == otherCell.getCid();
	}

	@Override
	public int hashCode() {
		return getLac() << 16 | getCid();
	}
}
